package kim.artemis.rpc.demo.provider.service.impl;

import kim.artemis.rpc.core.annotation.ArtemisRpcService;
import kim.artemis.rpc.demo.modal.Demo;
import kim.artemis.rpc.demo.service.DemoService;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

@Slf4j
@ArtemisRpcService
public class DemoServiceImpl implements DemoService {


    @Override
    public String demo(String str) {
        log.info(">>>>>>> 调用成功");
        return str.concat(" 调用成功");
    }

    @Override
    public Demo loadDemo (String id ){
        Demo demo = new Demo();
        if ( id.equals("1")) {

            demo.setDemoName("ArtemisDemoName");
            demo.setDemoGroup("Demo");
            demo.setDemoSort(1);
            demo.setDemoTime(new Date());
        }
        return demo;
    }

    @Override
    public void noResult(Demo demo) {
        log.info(">>>>>> 无返回调用成功: {}", demo.toString());
    }
}
